﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

namespace ThoiTrangT2B
{
    public partial class UCSearch : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                LoadHang();
            }
        }

        private void LoadHang()
        {
            string sql = "SELECT * FROM dbo.tblT2BDanhMuc WHERE MaDM = 'hang'";
            DataTable dt = SqlHelper.ExecuteDataTable(CommandType.Text, sql);
            cboHang.DataSource = dt;
            cboHang.DataTextField = "TenDM";
            cboHang.DataValueField = "ID";
            cboHang.DataBind();
            cboHang.Items.Insert(0, new ListItem("Chọn hãng sản xuất", "-1"));
        }

        protected void lbtGioHang_Click(object sender, EventArgs e)
        {
            Session["CurrentURL"] = Request.Url.ToString();
            Response.Redirect("GioHang.aspx");
        }
    }
}